package com.huaqin.develop.demotest.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 81010
 * @title: OBSController
 * @projectName demotest
 * @description: TODO
 * @date 2021/9/2622:18
 */

@Slf4j
@RestController
@RequestMapping("/obs")
public class OBSController {


//    @Autowired
//    private WmsPurchaseMapper wmsPurchaseMapper;

    @Autowired
    private RedisTemplate redisTemplate;


//    @GetMapping("hello")
//    public WmsPurchase hello(){
//        System.out.println("hello world");
//       // return wmsPurchaseMapper.selectByPrimaryKey(9l);
//    }


    @GetMapping("save")
    public String save(String key, String value) {

        //new RedisUtil().set(key, value,60);
        redisTemplate.opsForValue().set(key, value);


        return (String) redisTemplate.opsForValue().get(key);
    }


}
